package edu.kit.aifb.ldstream.stat.distrib;

import java.util.HashMap;
import java.util.Map;


public class DistributionParameters {
	
	/**
	 * Constant for the standard deviation parameter.
	 */
	public static final int STANDARD_DEVIATION = 0;
	/**
	 * Constant for the mean parameter.
	 */
	public static final int MEAN = 1;
	/**
	 * Constant for the rate parameter.
	 */
	public static final int RATE = 2;
	/**
	 * Constant for the lambda parameter.
	 */
	public static final int LAMBDA = 3;
	
	private Map<Integer,Double> parameters;
	
	public DistributionParameters(){
		this.parameters = new HashMap<Integer, Double>(5, 1);
	}
	public DistributionParameters(int capacity){
		this.parameters = new HashMap<Integer, Double>(capacity +1 ,1);
	}
	
	/**
	 * Returns the parameters.
	 * 
	 * @return the parameter Map.
	 */
	public Map<Integer, Double> getParameters(){
		return this.parameters;
	}
	
	/**
	 * Adding a parameter to the set. Only the given standard parameters are allowed.
	 * 
	 * @param constant of the parameter to be added.
	 * @param value of the parameter to be added.
	 */
	public void addParameter(int constant, double value){
		if( constant < 0 || constant > 3){
			throw new IllegalArgumentException("Parameter is not in range");
		}
		this.parameters.put(constant, value);
	}
	
	/**
	 * Deleting the parameter. Only the given standard parameters are allowed.
	 * 
	 * @param constant of the paramter to be deleted.
	 */
	public void deleteParameter(int constant){
		if( constant < 0 || constant > 3){
			throw new IllegalArgumentException("Parameter is not in range");
		}
		this.parameters.remove(constant);
	}
}
